package com.lei.library_mvp_retrofit.http.api;

import com.lei.library_mvp_retrofit.http.bean.LoginBean;
import com.lei.library_mvp_retrofit.http.bean.RegisterBean;
import com.lei.library_mvp_retrofit.http.bean.TokenBean;

import org.json.JSONObject;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * @ProjectName : YoHoJava_002
 * @Author : 雷金泷
 * @Time : 2021/1/8 16:18
 * @Description : 文件描述
 */
public interface Api {
    @FormUrlEncoded
    @POST("token")
    Call<TokenBean> token(@Field("grant_type") String password,@Field("username") String code,@Field("pwd") String null_pwd);


    /**
     * Request={"username":"wangzhonghua",
      "password":"rsa私钥加密后的密码"}
     * @return
     */
    @FormUrlEncoded
    @POST("Login.php")
    Observable<LoginBean> login(@Field("request") String request);

    @FormUrlEncoded
    @POST("Register.php")
    Observable<RegisterBean> register(@Field("request") String request);
}
